# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1ReplayConfig do
  @moduledoc """
  The configuration used for a Replay.

  ## Attributes

  *   `logSource` (*type:* `String.t`, *default:* `nil`) - The logs to use as input for the Replay.
  *   `policyOverlay` (*type:* `%{optional(String.t) => GoogleApi.PolicySimulator.V1.Model.GoogleIamV1Policy.t}`, *default:* `nil`) - A mapping of the resources that you want to simulate policies for and the policies that you want to simulate. Keys are the full resource names for the resources. For example, `//cloudresourcemanager.googleapis.com/projects/my-project`. For examples of full resource names for Google Cloud services, see https://cloud.google.com/iam/help/troubleshooter/full-resource-names. Values are Policy objects representing the policies that you want to simulate. Replays automatically take into account any IAM policies inherited through the resource hierarchy, and any policies set on descendant resources. You do not need to include these policies in the policy overlay.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :logSource => String.t() | nil,
          :policyOverlay =>
            %{optional(String.t()) => GoogleApi.PolicySimulator.V1.Model.GoogleIamV1Policy.t()}
            | nil
        }

  field(:logSource)
  field(:policyOverlay, as: GoogleApi.PolicySimulator.V1.Model.GoogleIamV1Policy, type: :map)
end

defimpl Poison.Decoder,
  for: GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1ReplayConfig do
  def decode(value, options) do
    GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1ReplayConfig.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1ReplayConfig do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
